package org.come.Jpanel;

import com.tool.image.ImageMixDeal;
import com.tool.role.RoleLingFa;
import com.tool.tcpimg.ChatBox;
import com.tool.tcpimg.PetSkillBox;
import com.tool.tcpimg.UIUtils;
import com.tool.tcpimg.WlinBox;
import come.tool.FightingData.FBUtil;
import org.come.Frame.MsgJframe1;
import org.come.Frame.ZhuFrame;
import org.come.bean.ImgZoom;
import org.come.bean.Skill;
import org.come.model.Lingbao;
import org.come.until.*;

import javax.swing.*;
import java.awt.*;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class MsgJapnel1 extends JPanel
{
    private JLabel goodsImg;
    private WlinBox box;
    private PetSkillBox petbox;
    private int boxx;
    private int boxy;
    private int boxw;
    private int boxh;
    private long time;
    private String vs;
    private ImgZoom imgZoom;

    public MsgJapnel1() {
        this.time = 0L;
        this.imgZoom = CutButtonImage.cuts("inkImg/old/8/ss145.png", 14, 7, true);
        this.box = new WlinBox();
        this.petbox = new PetSkillBox();
        this.box.setAlpha(0.6f);
        this.setLayout(null);
        this.setBackground(new Color(0, 0, 0, 0));
        (this.goodsImg = new JLabel()).setBounds(6, 10, 60, 60);
        this.add((Component)this.goodsImg);
    }

    @Override
    protected void paintComponent(final Graphics g) {
        super.paintComponent(g);
        final Graphics g2 = g.create(0, 0, this.boxw, this.boxh);
        this.box.paint(g2);
        this.petbox.paint(g2);
        g2.dispose();
        final Graphics2D g2d = (Graphics2D)g.create();
        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        final Font font = new Font("宋体", 0, 17);
        g2d.setFont(font);
        g2d.setColor(Color.yellow);
        g2d.drawString(this.vs, 68, 22);
        g2d.drawString(this.vs, 68, 22);
        g2d.drawString(this.vs, 68, 22);
    }

    public static String skillMsgchange(String remark, final Skill skillAll) {
        final int id = Integer.parseInt(skillAll.getSkillid());
        if (id == 9412 || id == 9811) {
            remark = remark.replace((CharSequence)"{公式三十二}", (CharSequence)String.valueOf(Arith.add(Arith.add(Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), Double.valueOf(skillAll.getGrow()).doubleValue()), Double.valueOf(skillAll.getValue()).doubleValue()), 20.0)));
            remark = remark.replace((CharSequence)"{公式三十}", (CharSequence)String.valueOf(Arith.div(Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), Double.valueOf(skillAll.getGrow()).doubleValue()), 125.0)));
            remark = remark.replace((CharSequence)"{公式三}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 4.0), 1.5), Double.valueOf(skillAll.getSkilllevel()).doubleValue())));
        }
        else {
            if (id == 9189) {
                remark = remark.replace((CharSequence)"{公式三十一}", (CharSequence)String.valueOf(Arith.sub(Arith.add(Double.valueOf(skillAll.getValue()).doubleValue(), 50.0), Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()))));
                remark = remark.replace((CharSequence)"{公式三十}", (CharSequence)String.valueOf(Arith.div(Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), Double.valueOf(skillAll.getGrow()).doubleValue()), 125.0)));
                remark = remark.replace((CharSequence)"{公式三}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 4.0), 1.5), Double.valueOf(skillAll.getSkilllevel()).doubleValue())));
            }
            else {
                if (id == 9382) {
                    remark = remark.replace((CharSequence)"{公式三十}", (CharSequence)String.valueOf(Arith.div(Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), Double.valueOf(skillAll.getGrow()).doubleValue()), 125.0)));
                    remark = remark.replace((CharSequence)"{公式三}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 4.0), 1.5), Double.valueOf(skillAll.getSkilllevel()).doubleValue())));
                }
                else {
                    if (id == 9372) {
                        remark = remark.replace((CharSequence)"{公式二十九}", (CharSequence)String.valueOf(Arith.sub(100.0, (Integer.parseInt(skillAll.getSkilllevel()) <= 2) ? Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), 10.0)) : Arith.add(10.0, Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), 5.0)))));
                    }
                    else {
                        if (id == 9370) {
                            remark = remark.replace((CharSequence)"{公式二十八}", (CharSequence)String.valueOf(Arith.add(Arith.mul(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), 3000.0), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), Arith.mul(Double.valueOf(skillAll.getValue()).doubleValue(), 1500.0))));
                            remark = remark.replace((CharSequence)"{公式二十七}", (CharSequence)String.valueOf(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), 3000.0))));
                        }
                        else {
                            if (id == 9365) {
                                remark = remark.replace((CharSequence)"{公式二十六}", (CharSequence)String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()).doubleValue(), Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Arith.mul(5.0, Double.valueOf(skillAll.getSkilllevel()).doubleValue())))));
                            }
                            else {
                                if (id == 9352) {
                                    remark = remark.replace((CharSequence)"{公式二十五}", (CharSequence)String.valueOf(Arith.add(25.0, Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 2.0), Arith.mul(5.0, Double.valueOf(skillAll.getSkilllevel()).doubleValue())))));
                                    remark = remark.replace((CharSequence)"{公式八}", (CharSequence)String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()).doubleValue(), Arith.div(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), 2.0))));
                                }
                                else {
                                    if (id == 9328) {
                                        remark = remark.replace((CharSequence)"{公式二十四}", (CharSequence)String.valueOf(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 4.0), Arith.mul(3.0, Double.valueOf(skillAll.getSkilllevel()).doubleValue()))));
                                        remark = remark.replace((CharSequence)"{公式二十三}", (CharSequence)String.valueOf(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 4.0), Double.valueOf(skillAll.getSkilllevel()).doubleValue())));
                                    }
                                    else {
                                        if (id == 9326) {
                                            remark = remark.replace((CharSequence)"{公式二十二}", (CharSequence)String.valueOf(Arith.add(Arith.mul(Arith.div(Double.valueOf(skillAll.getValue()).doubleValue(), 2.0), 5.0), Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()))));
                                        }
                                        else {
                                            if (id == 9307) {
                                                remark = remark.replace((CharSequence)"{公式二十一}", (CharSequence)String.valueOf(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 5.0), Arith.mul(2.0, Double.valueOf(skillAll.getSkilllevel()).doubleValue()))));
                                            }
                                            else {
                                                if (id == 9369) {
                                                    remark = remark.replace((CharSequence)"{公式三十三}", (CharSequence)String.valueOf(Arith.mul(2.0, Double.valueOf(skillAll.getSkilllevel()).doubleValue())));
                                                }
                                                else {
                                                    if (id == 9271) {
                                                        remark = remark.replace((CharSequence)"{公式十九}", (CharSequence)String.valueOf(Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), 1000.0))));
                                                    }
                                                    else {
                                                        if (id == 9269) {
                                                            remark = remark.replace((CharSequence)"{公式十八}", (CharSequence)String.valueOf(Arith.add(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Arith.mul((Integer.parseInt(skillAll.getSkilllevel()) <= 4) ? Double.valueOf(skillAll.getSkilllevel()).doubleValue() : Arith.add(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), 1.0), 500.0)), 13000.0)));
                                                            remark = remark.replace((CharSequence)"{公式十七}", (CharSequence)String.valueOf(Arith.add(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Arith.mul(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), 250.0)), 10000.0)));
                                                        }
                                                        else {
                                                            if (id == 9251) {
                                                                remark = remark.replace((CharSequence)"{公式十六}", (CharSequence)String.valueOf(Arith.sub(Arith.add(Double.valueOf(skillAll.getValue()).doubleValue(), (Integer.parseInt(skillAll.getSkilllevel()) > 3) ? Arith.sub(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), 3.0) : 0.0), 2.0)));
                                                                remark = remark.replace((CharSequence)"{公式十五}", (CharSequence)String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()).doubleValue(), (Integer.parseInt(skillAll.getSkilllevel()) <= 3) ? Double.valueOf(skillAll.getSkilllevel()).doubleValue() : 3.0)));
                                                            }
                                                            else {
                                                                if (id == 9250) {
                                                                    remark = remark.replace((CharSequence)"{公式十四}", (CharSequence)String.valueOf(Arith.div(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), 6.0)));
                                                                }
                                                                else {
                                                                    if (id == 9244) {
                                                                        remark = remark.replace((CharSequence)"{公式十三}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), 800.0)));
                                                                    }
                                                                    else {
                                                                        if (id == 9241) {
                                                                            remark = remark.replace((CharSequence)"{公式十二}", (CharSequence)String.valueOf(Arith.div(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Arith.div(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), 4000.0)), 6.0)));
                                                                        }
                                                                        else {
                                                                            if (id == 9231) {
                                                                                remark = remark.replace((CharSequence)"{公式十一}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), 10.0)));
                                                                            }
                                                                            else {
                                                                                if (id == 9227 || id == 9287 || id == 9711) {
                                                                                    remark = remark.replace((CharSequence)"{公式九}", (CharSequence)String.valueOf(Arith.sub(Double.valueOf(skillAll.getValue()).doubleValue(), Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()))));
                                                                                }
                                                                                else {
                                                                                    if (id == 9182) {
                                                                                        remark = remark.replace((CharSequence)"{公式八}", (CharSequence)String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()).doubleValue(), Arith.div(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), 2.0))));
                                                                                    }
                                                                                    else {
                                                                                        if (id == 9162 || id == 9265 || id == 9266) {
                                                                                            remark = remark.replace((CharSequence)"{公式七}", (CharSequence)String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()).doubleValue(), Arith.mul(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), 2.0))));
                                                                                        }
                                                                                        else {
                                                                                            if (id == 9152 || id == 9188) {
                                                                                                remark = remark.replace((CharSequence)"{公式六}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), 500.0)));
                                                                                                remark = remark.replace((CharSequence)"{公式五}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()), 3.0)));
                                                                                            }
                                                                                            else {
                                                                                                if (id == 9171) {
                                                                                                    remark = remark.replace((CharSequence)"{公式四}", (CharSequence)String.valueOf(Arith.add(Double.valueOf(skillAll.getSkilllevel()).doubleValue(), Double.valueOf(skillAll.getGrow()).doubleValue())));
                                                                                                }
                                                                                                else {
                                                                                                    if (id == 9125) {
                                                                                                        remark = remark.replace((CharSequence)"{公式三}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 4.0), 1.5), Double.valueOf(skillAll.getSkilllevel()).doubleValue())));
                                                                                                    }
                                                                                                    else {
                                                                                                        if (id == 9508) {
                                                                                                            remark = remark.replace((CharSequence)"{公式三十四}", (CharSequence)String.valueOf(Arith.mul(Double.parseDouble(skillAll.getGrow()), Arith.mul(600.0, Arith.mul(Double.parseDouble(skillAll.getSkilllevel()), Double.parseDouble(skillAll.getValue()))))));
                                                                                                        }
                                                                                                        else {
                                                                                                            if (id == 9510) {
                                                                                                                remark = remark.replace((CharSequence)"{公式三十五}", (CharSequence)String.valueOf(Arith.add(60.0, Arith.mul(Double.parseDouble(skillAll.getGrow()), Arith.mul(Double.parseDouble(skillAll.getSkilllevel()), 5.0)))));
                                                                                                            }
                                                                                                            else {
                                                                                                                if (id == 9511) {
                                                                                                                    remark = remark.replace((CharSequence)"{公式三十六}", (CharSequence)String.valueOf(Arith.mul(Double.parseDouble(skillAll.getGrow()), Arith.add(Double.parseDouble(skillAll.getSkilllevel()), 1.0))));
                                                                                                                    remark = remark.replace((CharSequence)"{公式三十七}", (CharSequence)String.valueOf(Arith.mul(10000.0, Arith.mul(Double.parseDouble(skillAll.getGrow()), Arith.add(Double.parseDouble(skillAll.getSkilllevel()), 1.0)))));
                                                                                                                }
                                                                                                                else {
                                                                                                                    if (id == 9612) {
                                                                                                                        remark = remark.replace((CharSequence)"{公式三十八}", (CharSequence)String.valueOf((Double.parseDouble(skillAll.getSkilllevel()) <= 2.0) ? 1 : ((Double.parseDouble(skillAll.getSkilllevel()) <= 4.0) ? 2 : 3)));
                                                                                                                    }
                                                                                                                    else {
                                                                                                                        if (id == 9191) {
                                                                                                                            remark = remark.replace((CharSequence)"{公式十}", (CharSequence)String.valueOf(Arith.add(Arith.mul(Double.parseDouble(skillAll.getGrow()), Double.parseDouble(skillAll.getSkilllevel())), Arith.add(50.0, Double.parseDouble(skillAll.getValue())))));
                                                                                                                        }
                                                                                                                    }
                                                                                                                }
                                                                                                            }
                                                                                                        }
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        remark = remark.replace((CharSequence)"{公式一}", (CharSequence)String.valueOf(Arith.add(Double.valueOf(skillAll.getValue()).doubleValue(), Arith.mul(Double.valueOf(skillAll.getGrow()).doubleValue(), Double.valueOf(skillAll.getSkilllevel()).doubleValue()))));
        remark = remark.replace((CharSequence)"{公式二}", (CharSequence)String.valueOf(Arith.mul(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 4.0), 10.0), Double.valueOf(skillAll.getSkilllevel()).doubleValue())));
        remark = remark.replace((CharSequence)"{公式二十}", (CharSequence)String.valueOf(Arith.mul(Arith.div(Double.valueOf(skillAll.getGrow()).doubleValue(), 2.0), Arith.mul(5.0, Double.valueOf(skillAll.getSkilllevel()).doubleValue()))));
        return remark;
    }

    public void smx(final Skill skill, final double sld, final int lvl) {
        this.petbox.removemsg();
        this.box.removemsg();
//        goodsImg.setBounds(180,30,40,40);
        final String[] iconx = skill.getSkillname().split("_");
        final Skill skillx = UserMessUntil.getskill1(iconx[0]);
//        final ImageIcon icon = new ImageIcon("img/skill/wxs_" + skillx.getSkillid() + ".png");
//        icon.setImage(icon.getImage().getScaledInstance(55, 55, 1));
        String msg = skill.getRemark();
        final int id = Integer.parseInt(skill.getSkillid());
        final double mv = Double.parseDouble(skill.getDielectric());// 耗蓝介质
        if (id >= 1001 && id <= 1100) {
        //    this.goodsImg.setIcon((Icon)icon);
            int level = Integer.parseInt(skill.getSkilllevel());// 技能等级
            double sv = Double.parseDouble(skill.getGrow());// 技能成长
            double value = Double.parseDouble(skill.getValue());// 介值
            final String type = (id <= 1005) ? "混乱" : ((id <= 1010) ? "封印" : ((id <= 1015) ? "昏睡" : ((id <= 1020) ? "中毒" : ((id <= 1025) ? "震慑" : ((id <= 1030) ? "力量" : ((id <= 1035) ? "抗性" : ((id <= 1040) ? "加速" : ((id <= 1045) ? "风" : ((id <= 1050) ? "雷" : ((id <= 1055) ? "水" : ((id <= 1060) ? "火" : ((id <= 1065) ? "鬼火" : ((id <= 1070) ? "三尸虫" : ((id <= 1075) ? "遗忘" : ((id <= 1080) ? "smmh" : ((id <= 1085) ? "霹雳" : ((id <= 1090) ? "沧波" : ((id <= 1095) ? "甘霖" : "扶摇"))))))))))))))))));
            if (id == 1048) {
                msg = msg.replace((CharSequence)"|个数|", (CharSequence)"2");
            }
            msg = msg.replace((CharSequence)"|个数|", (CharSequence)(FBUtil.geshu(level, (int)sld, type) + ""));
            final BigDecimal skillhitrate = new BigDecimal(value + sv * Math.pow(sld, 0.4) * 1.75 * (double)lvl);
            msg = msg.replace((CharSequence)"|伤害|", (CharSequence)"0");
            msg = msg.replace((CharSequence)"|蓝|", (CharSequence)((int)(mv * (sld / 25000.0)) + ""));
            msg = msg.replace((CharSequence)"|熟练|", (CharSequence)"1");
        }
        if (id >= 1500 && id <= 1887) {
      //      this.goodsImg.setIcon((Icon)icon);
            if (id == 1600) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 提高敌方全体金五行50";
            }
            if (id == 1601) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 提高敌方全体木五行50";
            }
            if (id == 1602) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 提高敌方全体土五行50";
            }
            if (id == 1876) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 全方位克技能：享受无属性和克属性的效果";
            }
            if (id == 1887) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 全方位克技能：享受无属性和克属性的效果";
            }
            if (id == 1839) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【消耗MP】" + (int)mv + "#r#W 牺牲自己，有几率使一个目标只能进行物理攻击";
            }
            if (id == 1603) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 提高敌方全体水五行50";
            }
            if (id == 1604) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 提高敌方全体火五行50";
            }
            if (id == 1605) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 消除敌方全部单位的五行";
            }
            if (id == 1606) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 给己方所有单位回复#r#W 60%的气血与60%的法力#r#R 10回合以后才可使用";
            }
            if (id == 1607) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 自己与己方任意单位同时隐身";
            }
            if (id == 1877) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 自己与己方任意单位同时隐身";
            }
            if (id == 1608) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 群体解除本方全体被控制状态#r#R 整场战斗只可使用1次。";
            }
            if (id == 1609) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 消耗自身50%气血和20%法力上限#r#W 使伤害提至2.5倍。";
            }
            if (id == 1611) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 给己方三个单位回复50%的气血及法力#r#W 整场战斗只可使用1次。";
            }
            if (id == 1612) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 解除本方3个单位的被控制状态#r#W 整场战斗只可使用1次。";
            }
            if (id == 1868) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 指定本方任意一个召唤兽消耗50%的法量上线使处于冷却中的技能本回合就能立即使用，普通高级技能冷却10回合，终极技能冷却20回合";
            }
            if (id == 1500) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 通过牺牲自己的HP给对手造成伤害";
            }
            if (id == 1501) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 通过牺牲自己的HP给对手造成伤害";
            }
            if (id == 1502) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 通过牺牲自己的MP给对手造成伤害";
            }
            if (id == 1503) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 通过牺牲自己的MP给对手造成伤害";
            }
            if (id == 1887) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 提高敌方全体五行45%，持续3回合#r#W 冷却时间5回合额。";
            }
        }
        if (id >= 1200 && id <= 1273) {
            final long qm = UserMessUntil.getChosePetMes().getFriendliness().longValue();
            final double value2 = Double.parseDouble(skill.getValue());
            final double sv2 = Double.parseDouble(skill.getGrow());
        //    this.goodsImg.setIcon((Icon)icon);
            if (id == 1200) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 给自方所有在场单位施加庇护状态#r#W（死亡和封印状态除外） #r#W 白泽可为此状态成员承担部分伤害 #r#W 且自身所受伤害弱化";
            }
            if (id == 1204) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【目标数】3#r#Y【持续回合】2#r#Y【消耗MP】" + (int)mv + "#r#W 降低敌方仙法抗性减20% #r#W 人法抗性减8%。";
            }
            if (id == 1221) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【目标数】2#r#Y【持续回合】2#r#Y【消耗MP】" + (int)mv + "#r#W 减低2个目标的速度，持续2回合。";
            }
            if (id == 1202) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【目标数】3#r#Y【持续回合】2#r#Y 【消耗MP】" + (int)mv + "#r#W  减少目标抗性#r#W 【抗震慑】-10%#r#W 【抗遗忘】-8%#r#W 【抗鬼火】-20%#r#W 【抗三尸虫】-1000";
            }
            if (id == 1203) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【目标数】1#r#Y【持续回合】3#r#Y 【消耗MP】" + (int)mv + "#r#W  减少目标抗性#r#W 【抗震慑】-15%#r#W 【抗遗忘】-12%#r#W 【抗鬼火】-25%#r#W 【抗三尸虫】-2000";
            }
            if (id == 1205) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【目标数】1#r#Y【持续回合】3#r#Y【消耗MP】" + (int)mv + "#r#W 降低敌方仙法抗性减25%#r#W 人法抗性减12%。";
            }
            if (id == 1215) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【冷却回合】5#r#Y【消耗MP】" + (int)mv + "#r#W 该召唤兽与战斗中任意目标交换状态。#r#W (盘，牛，速，冰，混)#r#W (睡，忘，毒，魅, 惑)";
            }
            if (id == 1234) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】3#r#Y【只针对PVp有用】#r#Y【消耗MP】" + (int)mv + "#r#W 敌方释放师门技能时#r#W 有几率将师门法术返还给敌方#r#W 亲密越高返还的几率越大#r#W 该技能在场只能生效一次";
            }
            if (id == 1246) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 增加附法内丹伤害, #r#W有一定几率出现法术狂暴效果!";
            }
            if (id == 1247) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【学习要求】根骨>=500#r#Y【消耗MP】" + (int)mv + "#r#Y【针对目标数】1#r#W 增加内丹反震效果#r#W 免疫仙法鬼火伤害!#r#W 血量低于30%有一定几率护盾加身!";
            }
            if (id == 1248) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【学习要求】力量>=500#r#Y【消耗MP】" + (int)mv + "#r#W 增加30%的攻击力#r#W 被攻击方血量低于30%有几率一击毙命!";
            }
            if (id == 1249) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【持续回合】2#r#Y【学习要求】敏捷>=500#r#Y【消耗MP】" + (int)mv + "#r#W 回合开始时有几率偷取对方#r#W 第一个出手的技能为己方所用!#r#W 且自己进入隐身状态!";
            }
            if (id == 1250) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 牺牲自己的行动3个回合#r#W (不能使用药品,不能攻击,不能使用法术)#r#W 把己方随机3个单位所受的伤害转嫁到对方身上 #r#R (前十回合不能使用,每场战斗只能生效一次)";
            }
            if (id == 1251) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 释放一个强力的隐身技能!#r#W 清除所有的负面状态#r#W 己方所有成员进入不能被选定状态! #r#R (前十回合不能使用,每场战斗只能生效一次)";
            }
            if (id == 1252) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 物理攻击敌方5个目标";
            }
            if (id == 1253) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 物理攻击一个目标#r#W 有几率消耗对手的MP值";
            }
            if (id == 1254) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【消耗MP】" + (int)mv + "#r#W 法术攻击敌方5个目标";
            }
            if (id == 1255) {
                msg = "#r#W【消耗MP】#W30%#r#G增加连击几率#r#G增加反震几率#r#G增加内丹附法几率";
            }
            if (id == 1258) {
                msg = "#r#W【消耗MP】" + (int)mv + "#r#W当兰亭处于隐身状态时#r#W可将自己的隐身状态转移给主人。";
            }
            if (id == 1270) {
                msg = "#r#W给队友增加隐身状态，持续2回合，冷却4回合。";
            }
            if (id == 1264) {
                msg = "#r#W一声：【剑来】召唤无数利剑攻击敌人，有20%几率随机目标产生双倍伤害，施法者法力值越高伤害越高。由于太过残暴，施法者遭天地约束，攻击目标会在1-10之间波动，冷却时间2回合。施法结束后有百分之30的几率进入隐身状态";
            }
        }
        if (id >= 1200 && id <= 550065) {
            final long qm = UserMessUntil.getChosePetMes().getFriendliness().longValue();
            final double value2 = Double.parseDouble(skill.getValue());
            final double sv2 = Double.parseDouble(skill.getGrow());
//            this.goodsImg.setIcon((Icon)icon);
            if (id == 550065) {
                msg = "#cFF8C00 " + skill.getSkillname() + "#r#Y【目标数】1#r#Y【消耗MP】" + (int)mv + "#r#W 主动使用后可清除目标身上的加速/减速效果，同时为其附加驻足状态，使其1回合内无法再次被添加加速/减速效果，驻足状态有概率延长一回合，技能冷却时间5回合。";

            }
        }
        this.vs = skill.getSkillname();
        this.petbox.addText(" ", 320, new Font("宋体", 1, 20));
        this.petbox.addText(msg, 320, UIUtils.TEXT_FONT2);
        this.boxw = 320;
        this.boxh = ScrenceUntil.Screen_y;
        final Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(), new Dimension(this.boxw, this.boxh));
        this.boxx = (int)goodx.getX() + 8;
        this.boxy = (int)goodx.getY() + 450;
        this.displaymsg();
    }

    public void SM(final Skill skill, final double sld, final int lvl) {
        this.petbox.removemsg();
        this.box.removemsg();
        final String[] iconx = skill.getSkillname().split("_");
        final Skill skillx = UserMessUntil.getskill1(iconx[0]);
        final ImageIcon icon = new ImageIcon("inkImg/old/skill/Skill2/40/" + skillx.getSkillid() + ".png");
        icon.setImage(icon.getImage().getScaledInstance(60, 60, 1));
        String msg = skill.getRemark();
        final int id = Integer.parseInt(skill.getSkillid());
        if (id >= 1001 && id <= 1100) {
            final int level = Integer.parseInt(skill.getSkilllevel());
            final double sv = Double.parseDouble(skill.getGrow());
            final double mv = Double.parseDouble(skill.getDielectric());
            final double value = Double.parseDouble(skill.getValue());
            this.goodsImg.setIcon((Icon)icon);
            final String type = (id <= 1005) ? "混乱" : ((id <= 1010) ? "封印" : ((id <= 1015) ? "昏睡" : ((id <= 1020) ? "中毒" : ((id <= 1025) ? "震慑" : ((id <= 1030) ? "力量" : ((id <= 1035) ? "抗性" : ((id <= 1040) ? "加速" : ((id <= 1045) ? "风" : ((id <= 1050) ? "雷" : ((id <= 1055) ? "水" : ((id <= 1060) ? "火" : ((id <= 1065) ? "鬼火" : ((id <= 1070) ? "三尸虫" : ((id <= 1075) ? "遗忘" : ((id <= 1080) ? "smmh" : ((id <= 1085) ? "霹雳" : ((id <= 1090) ? "沧波" : ((id <= 1095) ? "甘霖" : "扶摇"))))))))))))))))));
            msg = msg.replace((CharSequence)"|个数|", (CharSequence)(FBUtil.geshu(level, (int)sld, type) + ""));
            if (id <= 1015 || (id >= 1071 && id <= 1075)) {
                final BigDecimal skillhitrate = new BigDecimal(value + sv * new BigDecimal(Math.pow(sld, 0.3)).setScale(2, 4).doubleValue());
                msg = msg.replace((CharSequence)"|几率|", (CharSequence)skillhitrate.setScale(2, 4).toString());
                msg = msg.replace((CharSequence)"|回合|", (CharSequence)"7");
            }
            else {
                if (id <= 1020) {
                    final BigDecimal skillhitrate = new BigDecimal((double)(int)((value + sld * sv / 1000.0) * 1000.0) / 15.0 * 17.0);
                    msg = msg.replace((CharSequence)"|伤害|", (CharSequence)((level > 3) ? "15" : ((level > 1) ? "12.5" : "10")));
                    msg = msg.replace((CharSequence)"|几率|", (CharSequence)skillhitrate.setScale(2, 4).toString());
                    msg = msg.replace((CharSequence)"|回合|", (CharSequence)"3");
                }
                else {
                    if (id <= 1040 || (id >= 1076 && id <= 1080)) {
                        final BigDecimal skillhitrate = new BigDecimal((double)(int)((value + sld * sv / 1000.0) * 1000.0) / 10.0);
                        msg = msg.replace((CharSequence)"|回合|", (CharSequence)"7");
                        msg = msg.replace((CharSequence)"|伤害|", (CharSequence)skillhitrate.setScale(2, 4).toString());
                    }
                    else {
                        if (id <= 1065 || id >= 1081) {
                            final BigDecimal skillhitrate = new BigDecimal(value + sv * Math.pow(sld, 0.4) * 1.75 * (double)lvl);
                            msg = msg.replace((CharSequence)"|伤害|", (CharSequence)(skillhitrate.intValue() + ""));
                        }
                        else {
                            if (id <= 1070) {
                                msg = msg.replace((CharSequence)"|伤害|", (CharSequence)((int)((value * (double)lvl + sld * sv / 1000.0) * 1000.0) + ""));
                                msg = msg.replace((CharSequence)"|几率|", (CharSequence)((int)(value * 100.0 + (double)(int)(sld / 250.0)) + ""));
                            }
                        }
                    }
                }
            }
            msg = msg.replace((CharSequence)"|蓝|", (CharSequence)((int)(mv * (sld / 25000.0 + 1.0)) + ""));
            msg = msg.replace((CharSequence)"|熟练|", (CharSequence)((int)sld + "/" + (int)sld));
        }
        else {
            if (id >= 5001 && id <= 5015) {
                msg = "#c8A2BE2" + skill.getSkillname() + "#r#Y【消耗怨气值】" + skill.getDielectric() + "#r#W" + msg;
                final int born = ImageMixDeal.userimg.getRoleShow().getTurnAround();
                final int lvl2 = AnalysisString.lvlint(ImageMixDeal.userimg.getRoleShow().getGrade().intValue());
                final int bzlvl = RoleLingFa.getRoleLingFa().getFaPJ();
                final Lingbao fabao = RoleLingFa.getRoleLingFa().getFabaoByName(skill.getSkillname());
                if (fabao == null) {
                    return;
                }
                else {
                    final int qv = RoleLingFa.getQv(fabao.getBaoquality());
                    final int blvl = fabao.getLingbaolvl().intValue();
                    final int pz = FBUtil.getFBlvl(born, lvl2, bzlvl, qv, blvl);
                    double grow = 0.0;
                    double value2 = 0.0;
                    if (skill.getGrow() != null && !skill.getGrow().equals("")) {
                        grow = Double.parseDouble(skill.getGrow());
                    }
                    if (skill.getValue() != null && !skill.getGrow().equals("")) {
                        value2 = Double.parseDouble(skill.getValue());
                    }
                    final String v1 = UserData.xiaoshu(value2 + (double)pz * grow);
                    final String v2 = FBUtil.getFBcx(id, blvl) + "";
                    String v3 = null;
                    final String v4 = FBUtil.getFBsum(id, blvl) + "";
                    if (id == 4014) {
                        v3 = (int)((value2 + (double)pz * grow) * 12500.0) + "";
                    }
                    else {
                        if (id == 4015) {
                            v3 = UserData.xiaoshu((value2 + (double)pz * grow) * 2.0 / 3.0);
                        }
                    }
                    msg = msg.replace((CharSequence)"{概率}", (CharSequence)("#R" + v1 + "#W"));
                    msg = msg.replace((CharSequence)"{回合}", (CharSequence)("#G" + v2 + "#W"));
                    if (v3 != null) {
                        msg = msg.replace((CharSequence)"{数值}", (CharSequence)("#Y" + v3 + "#W"));
                    }
                    msg = msg.replace((CharSequence)"{目标}", (CharSequence)("#Y" + v4 + "#W"));
                }
            }
            else {
                if (id >= 9101 && id <= 9812) {
                    msg = skillMsgchange(msg, skill);
                    msg = "#cFF8C00" + skill.getSkillname() + "#r#Y【消耗怒气值】" + skill.getDielectric() + "#r#W" + msg;
                }
                else {
                    return;
                }
            }
        }
        this.vs = skill.getSkillname();
        this.box.addText(" ", 200, new Font("宋体", 0, 17));
        this.box.addText(msg, 280, new Font("宋体", 0, 15));
        this.boxw = this.box.getWidth();
        this.boxh = ScrenceUntil.Screen_y;
        final Point goodx = ZhuFrame.getZhuJpanel().framepoint(GameJpanel.getGameJpanel().getMousePosition(), new Dimension(this.boxw, this.boxh));
        this.boxx = (int)goodx.getX() + 8;
        this.boxy = (int)goodx.getY() + 150;
        this.displaymsg();
    }

    public static String StringReplace(final String vs) {
        final Pattern p = Pattern.compile(">(.*?)<");
        final Matcher m = p.matcher((CharSequence)vs);
        final Pattern pend = Pattern.compile("'#(.*?)'");
        final Matcher mend = pend.matcher((CharSequence)vs);
        final StringBuffer sb1 = new StringBuffer();
        while (mend.find()) {
            final String s = mend.group();
            if (!sb1.toString().equals("")) {
                sb1.append("|" + s.split("'#")[1].split("'")[0]);
            }
            else {
                sb1.append(s.split("'#")[1].split("'")[0]);
            }
        }
        final StringBuffer sb2 = new StringBuffer();
        while (m.find()) {
            final String s2 = m.group();
            if (!s2.equals("><")) {
                if (!sb2.toString().equals("")) {
                    sb2.append("|" + s2.split(">")[1].split("<")[0]);
                }
                else {
                    sb2.append(s2.split(">")[1].split("<")[0]);
                }
            }
        }
        final StringBuffer buffer = new StringBuffer();
        final String[] v = sb1.toString().split("\\|");
        final String[] v2 = sb2.toString().split("\\|");
        int i = 0;
        while (i < v.length && i < v2.length) {
            if (!buffer.toString().equals("")) {
                buffer.append("|" + v[i] + "=" + v2[i]);
            }
            else {
                buffer.append(v[i] + "=" + v2[i]);
            }
            ++i;
        }
        return buffer.toString();
    }

    public void displaymsg() {
        MsgJframe1.getJframe1().setBounds(this.boxx, this.boxy, this.boxw, this.boxh);
        FormsManagement.showForm(667);
    }

    public WlinBox getBox() {
        return this.box;
    }

    public void setBox(final WlinBox box) {
        this.box = box;
    }

    public JLabel getGoodsImg() {
        return this.goodsImg;
    }

    public void setGoodsImg(final JLabel goodsImg) {
        this.goodsImg = goodsImg;
    }
}
